<template>
  <div class="module-basic-major">
    <el-row style="height:100%;">
      <el-col style="height:100%;">
        <table-panel :name="'专业信息'" :columns="majorColumns" :tableData="majorData" :showRowNumber="true" :multiSelection="true"
        :usePagination="false" 
        :canCreate="authorities.create" :canEdit="authorities.edit" :canDelete="authorities.delete"
        :currentPage="majorCurrentPage" :totalNum="majorTotalNum" @page-change="onPageChange('major',$event)" :pageSize="pageSize"
        @table-searching="onSearching('major',$event)"
        @table-create="onCreate('major',$event)" @table-edit="onEdit('major', $event)"
        @table-delete="onDelete('major',$event)" @table-export="onExport('major',$event)"
        @selection-change="onSelectionChange('major',$event)"></table-panel>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import TablePanel from "@/components/basic/TablePanel";
import {
  formModelInitFromTable,
  formRulesInitFromTable
} from "@/utils/formutils.js";
import { trueFalseRenderer } from "@/utils/tableutils.js";

// meta info
var major = "major"; // 表格名称
var columnsAttr = "Columns"; // 列
var dataAttr = "Data"; // 数据
var selectionAttr = "Selection"; // 选中
var dlgVisibleAttr = "DlgVisible"; // 对话框
var formAttr = "Form";
var recordAttr = "Record"; // 表单模型
var rulesAttr = "Rules"; // 表单验证
var curPageAttr = "CurrentPage";// 分页-当前页
var totalNumAttr = "TotalNum";// 分页-总数
var qParamAttr = "QueryParams";// 查询参数

var majorColumns = [];

export default {
  name: "Major",
  components: {
    "table-panel": TablePanel
  },
  data() {
    return {
      authorities:{
        create:true,
        delete:true,
        edit:true,
        search:true
      },// 权限控制
      [major + columnsAttr]: majorColumns, // 表格-列
      [major + dataAttr]: [], // 表格的数据
      [major + selectionAttr]: [], // 当前选中
      [major + dlgVisibleAttr]: false, // 对话框是否可见
      [major + recordAttr]: {}, // 表单模型
      [major + rulesAttr]: {}, // 表单验证
      [major + curPageAttr]:1,// 当前页
      [major + totalNumAttr]:0,// 总数
      [major + qParamAttr]:{},// 查询参数
      pageSize:20,// 每页数量
      facultyData:[]
    };
  },
  created: function() {
    var me = this;
    // 添加权限控制
    // me.authorities = me.$route.meta.authorities;
  }
}
</script>
<style lang="scss">
.module-basic-major{
  height: 100%;
}
</style>
